import pandas as pd
from sklearn import linear_model
import matplotlib.pyplot as plt
import numpy

data = pd.read_csv('data.csv')
plt.scatter(data.sequare_feet, data.price)
plt.show

x = data.sequare_feet
y = data.price

# 任务1.1
lrModel = linear_model.LinearRegression()
lrModel.fit(x.values.reshape(-1, 1), y)
predit_y = lrModel.predict([[1000]])
print(predit_y)

X = data.iloc[:,1:3]
mulModel = linear_model.LinearRegression()
mulModel.fit(X,y)
y_m=mulModel.predict([[1000,0.7]])
print(y_m)